package com.wu.client.controller;

import com.wu.client.service.FeaturedService;
import com.wu.client.vo.req.album.AlbumReq;
import com.wu.client.vo.req.artist.ArtistReq;
import com.wu.client.vo.res.PageResp;
import com.wu.client.vo.res.album.AlbumBaseResp;
import com.wu.client.vo.res.artist.ArtistBaseResp;
import com.wu.client.vo.res.mv.MvBaseResp;
import com.wu.common.convertion.result.Result;
import com.wu.common.convertion.result.Results;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Cousin
 * @date 2025/3/28
 * @Description
 */
@RestController
@RequestMapping("featured")
@RequiredArgsConstructor
public class FeaturedController {
    private final FeaturedService featuredService;
    @GetMapping("artists")
    public Result<PageResp<ArtistBaseResp>> getFeaturedArtists(ArtistReq req){
        return Results.success(featuredService.getFeaturedArtists(req));
    }
    @GetMapping("albums")
    public Result<PageResp<AlbumBaseResp>> getFeaturedAlbums(AlbumReq req){
        return Results.success(featuredService.getFeaturedAlbums(req));
    }
    @GetMapping("mvs")
    public Result<PageResp<MvBaseResp>> getFeaturedMvs(@RequestParam(required = false) Long userId
            ,@RequestParam(defaultValue = "1") Integer page,@RequestParam(defaultValue = "10") Integer limit){
        return Results.success(featuredService.getFeaturedMvs(page,limit,userId));
    }
}
